package L01;

public class T06 {
    public static void main (String[] args) {
        Thread t=new Thread (()->{
            while(true){
                System.out.println ("hello thread");
                try {
                    Thread.sleep (1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException (e);
                }
            }
        },"新线程");
        //设置为后台线程，前台线程运行完后线程才可以结束
        //后台线程与线程的结束没有关系
        t.setDaemon (true);
        t.start ();



    }
}
